package com.xly.webclick.presenter;

import com.xly.webclick.base.BasePresenter;
import com.xly.webclick.model.TaskData;
import com.xly.webclick.net.Request;
import com.xly.webclick.net.RetrofitApi;
import com.xly.webclick.vi.GetTaskInterface;

/**
 * Created by xuleyuan on 2018/8/18
 */

public class GetTaskPresenter extends BasePresenter<GetTaskInterface, TaskData> {

    @Override
    public Request<TaskData> createRequest() {
        return new Request<TaskData>().setMethod(Request.POST).setUrl(RetrofitApi.LOGIN);
    }

    @Override
    public void onGetResult(TaskData data) {
        getBaseInterface().onGetTask(data);
    }

    @Override
    public void onError(Throwable throwable) {
        getBaseInterface().getTaskError(throwable);
    }
}
